import api from "../../utils/api";
const index = {
  state: {
    // swper
    swperlist: "",
    // read
    readlist: "",
  },
  mutations: {
    // swper
    getswperlist(state, paylode) {
      state.swperlist = paylode;
    },
    // read
    getread(state, paylode) {
      state.readlist = paylode;
    },
  },
  actions: {
    // swper
    getswperlistAsync: async (context) => {
      const res = await api.getswiper();
      if (res.status == 0) {
        context.commit("getswperlist", res.result);
        // console.log(res);
      }
    },
    // read
    async getreadAsync(context) {
      const res = await api.getreadinfo();
      if (res.status == 0) {
        context.commit("getread", res.result);
        // console.log(res);
      }
    },
  },
};
export default index;
